473,425 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

Passing param to linkbutton

Hi, I want to create a datagrid with an extra column
containing a linkbutton. Clicking on the linkbutton
invokes a function and passes a parameter containing the
id of the row in question. I've been struggling with this
for a while now. Any help would be really appreciated!
See the code below.
The error I get is "The best overloaded method match for
OnDelete(long)' has some invalid arguments"
IN HTML:
<asp:datagrid id="grid" AutoGenerateColumns="False"
Runat="server">
<Columns>
<asp:BoundColumn DataField="UserName"
HeaderText="Name"></asp:BoundColumn>
<asp:templatecolumn>
<headertemplate>Delete Option</headertemplate>
<itemtemplate>
<asp:LinkButton id="lbtnDelete" Text="Delete"
OnCommand="CommandBtn_Click" CommandName="Id"
CommandArgument="<%# DataBinder.Eval
(Container.DataItem, "Id") %>" runat="server" />
</itemtemplate>
</asp:templatecolumn>
</Columns>

SCRIPT IN HEADER
<script language="C#" runat="server">
void CommandBtn_Click(object sender,CommandEventArgs e)
{
OnDelete(e.CommandArgument);
}
</script>
CODEBEHIND:
public void OnDelete(long id)
{
Delete(id);
}
Nov 16 '05 #1
0 1083

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eric Wagar | last post by:
I have a phpnuke website, and I use DigiChat chat. Since I have users who register, I'd like to be able to pass there username and email (at a minimum) into the chat system, so they do not have to...
27
by: Oscar | last post by:
I am looking for a way to pass an ADO recordset that has been retrieved in an ASP page to another HTML-page. Is there someone who can provide me with a small sample or a link to see how this is...
4
by: Alfred Taylor | last post by:
I essentially need a countif() function for xsl. Something to where I could do countif(node-set, condition). Rather than try to get too extreme, i decided to just write one for my countif() with...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
7
by: Cemal Karademir | last post by:
Hello, Please forgive my simple question, but i don't know the correct synatx. From the masterpage i want to put a text in an textbox and then select an item in the datagrid. I do know how to...
1
by: bill tie | last post by:
I create several link buttons based on database data. When a user clicks a link button, 1. I want to pass the value of the button as a parameter to an SQL query string; 2. suck more data out of...
12
by: dave_dp | last post by:
Hi, I have just started learning C++ language.. I've read much even tried to understand the way standard says but still can't get the grasp of that concept. When parameters are passed/returned...
6
by: David Schwartz | last post by:
I have a template that searches for and replaces found instances of strings in other strings and replaces them with yet another string. These strings are passed to the template as parameters, not...
8
by: asit | last post by:
How do I pass parameters to created thread..here is the code(but it can't pass data..it uses global variable) #include <windows.h> #include <stdio.h> DWORD Sum; DWORD WINAPI...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.